import request from '@/utils/request'

export function getLoopListByGatewayId(query) {
    return request({
        url: '/business/loop/all',
        method: 'get',
        params: query
    })
}

/**
 * 分页查询控制点列表
 */
export function pageListLoop(query) {
    return request({
        url: '/business/loop/page/list',
        method: 'get',
        params: query
    })
}

/**
 * 查询控制点列表
 */
export function listLoop(query) {
    return request({
        url: '/business/loop/list',
        method: 'get',
        params: query
    })
}

// 查询回路详细
export function getLoop(loopId) {
    return request({
        url: '/business/loop/' + loopId,
        method: 'get'
    })
}

// 新增回路
export function addLoop(data) {
    return request({
        url: '/business/loop',
        method: 'post',
        data: data
    })
}

// 修改回路
export function updateLoop(data) {
    return request({
        url: '/business/loop',
        method: 'put',
        data: data
    })
}

// 删除回路
export function delLoop(loopId) {
    return request({
        url: '/business/loop/' + loopId,
        method: 'delete'
    })
}
